import sqlite3

def account_check(account, password, db_path):
    db_path = db_path.replace("\\", "\\\\")
    conn = sqlite3.connect(db_path)
    cursor = conn.cursor()
    cursor.execute(f"select `userid`, `password`, `isroot` from `sign` where `account` = '{account}';")
    result = cursor.fetchone()
    if result is None:
        return 0
    else:
        userid = result[0]
        print(userid)
        stored_password = result[1]
        isroot = result[2]
        if stored_password == password:
            print("密码正确")
        else:
            print("密码错误")
    cursor.close()
    conn.close()
    return userid, isroot